import { _decorator, Component, Node } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('GlobalVar')
class GlobalVar {
    private static _instance: GlobalVar = null;
    private Currency: number = 0;
    private CardsInSlot: Node[] = [];
    private ClassicModeLevel: number = 1;

    public static getInstance(): GlobalVar {
        if (this._instance == null) {
            this._instance = new GlobalVar();
        }
        return this._instance;
    }
    
    public getCurrency(): number {
        return this.Currency;
    }
    public setCurrency(value: number): void {
        this.Currency = value;
    }
    public getCardInSlot(): Node[] {
        return this.CardsInSlot;
    }
    public clearCardInSlot() {
        this.CardsInSlot = [];
    }
    public setClassicModeLevel(level: number) {
        this.ClassicModeLevel = level;
    }
    public getClassicModeLevel(): number {
        return this.ClassicModeLevel;
    }
}
export const GLOBALVar = GlobalVar.getInstance();


